﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using DotNet.Model;
using DotNet.Common;
using DotNet.Data.Factory;
using DotNet.Business;
using System.Data.SqlClient;
using System.Text;


public partial class Admin_adminSqlHelper : basePage
{
    IDBHelp db = DBHelp.Create();
    adminSqlHelperBll sqlHelperBll = new adminSqlHelperBll();
    StringBuilder str = new StringBuilder();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["action"] == "exe")
            {
                exeSql(Request.Form["sqlStr"].ToString());
            }
        }
    }
    public void exeSql(string sqlStr) 
    {
        if (sqlStr.Trim() == "") Response.End();
        string sql = CommUtil.NoHTML(sqlStr);
        int result = 0;
        try
        {
            result=sqlHelperBll.ExecuteNoQuery(Server.UrlDecode(sqlStr));
            Response.Write("1");             
        }
        catch
        {
            Response.Write("2");
        }
        finally
        {

        }
        Response.End();
    }
}
